home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
timetrak
/
report.bas
< prev
next >
Wrap
BASIC Source File
|
1995-09-06
|
4KB
|
128 lines
Sub Print_Detail ()
linecnt = linecnt + 1
GetField ttrakRec, 5, "A"
dwho$ = Mid$(returnfld, 1, 3)
If dwho$ = "HDR" Then
If Mid$(savtotal, 1, 1) <> "0" Then
If printFlag = 1 Then
report1.detail.Print Tab(15); "total hours: "; savtotal
report1.detail.Print
Else
printer.Print Tab(15); "total hours: "; savtotal
printer.Print
End If
End If
GetField ttrakRec, 4, "N"
savtotal = RTrim$(returnfld)
Exit Sub
End If
GetField ttrakRec, 1, "A"
dProj$ = RTrim$(returnfld)
GetField ttrakRec, 3, "D"
dDate$ = returnfld
GetField ttrakRec, 4, "N"
dHours$ = returnfld
If printFlag = 1 Then
report1.detail.Print Tab(2); Mid$(dProj$, 1, Len(dProj$) - 1); Tab(22); RTrim$(dDate$); Tab(34); RTrim$(dHours$); Tab(41); RTrim$(dwho$)
Else
printer.Print Tab(2); Mid$(dProj$, 1, Len(dProj$) - 1); Tab(22); RTrim$(dDate$); Tab(34); RTrim$(dHours$); Tab(41); RTrim$(dwho$)
End If
End Sub
Sub Print_header ()
If printFlag = 2 Then
' printer.fontname = "Tms Rmn"
printer.fontname = "courier"
printer.fontbold = -1
' printer.fontsize = 13.5
printer.fontsize = 12
printer.Print Tab(10); "Time Tracking Report"
pageno = printer.page
printer.Print Tab(16); "Page: "; pageno
printer.Print
printer.fontunderline = -1
printer.fontsize = 8.25
printer.Print Tab(2); "Project"; Tab(23); " Date "; Tab(33); "Hours"; Tab(41); "Who"
printer.fontunderline = 0
printer.fontbold = 0
printer.Print
Else
report1.header.Print Tab(2); "Project"; Tab(23); " Date "; Tab(33); "Hours"; Tab(41); "Who"
End If
End Sub
Sub Print_Report (direction As Integer)
If direction = 1 Then
If rc = PXERR_ENDOFTABLE Then
Exit Sub
End If
pageno = pageno + 1
key1(pageno, 1) = key1(pageno - 1, 2)
key2(pageno, 1) = key2(pageno - 1, 2)
ElseIf direction = 0 Then
If pageno = 1 Then
Exit Sub
End If
pageno = pageno - 1
If pageno = 1 Then
savtotal = "0"
End If
End If
report1.detail.Cls
report1.detail.currentX = 0
report1.detail.currentY = 0
report1.pagenbr.caption = "Page" + Str$(pageno)
rc = PXPutAlpha(ttrakRec, 1, key1(pageno, 1))
PXError
rc = PXPutShort(ttrakRec, 2, key2(pageno, 1))
PXError
rc = PXSrchKey(ttrakTbl, ttrakRec, 2, SEARCHFIRST)
' PXError
If pageno > 1 And direction = 1 And printFlag = 1 Then
PXNext ttrakTbl, ttrakRec
End If
linecnt = 0
If printFlag = 2 Then
rc = PXRecFirst(ttrakTbl)
PXError
End If
Do Until rc = PXERR_ENDOFTABLE
rc = PXRecGet(ttrakTbl, ttrakRec)
PXError
GetField ttrakRec, 1, "A"
key1(pageno, 2) = RTrim$(returnfld)
GetField ttrakRec, 2, "N"
key2(pageno, 2) = Val(returnfld)
If projFlag = 1 Then
If projectname = Mid$(key1(pageno, 2), 1, Len(projectname)) Then
Print_Detail
End If
Else
Print_Detail
End If
PXNext ttrakTbl, ttrakRec
If printFlag = 1 And linecnt = 15 Then
Exit Do
End If
Loop
If rc = PXERR_ENDOFTABLE Then
If printFlag = 1 Then
report1.detail.Print Tab(15); "total hours: "; savtotal
report1.Show
Else
printer.Print Tab(15); "total hours: "; savtotal
printer.EndDoc
screen.mousepointer = 1
End If
End If
If printFlag = 1 Then
report1.Show
Else
Unload prtfrm
Unload printselect
End If
End Sub